//package com.kws.system.controller;
//
//import java.util.List;
//import javax.servlet.http.HttpServletResponse;
//
//import com.kws.common.core.domain.R;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import com.kws.common.core.constant.CacheConstants;
//import com.kws.common.core.utils.poi.ExcelUtil;
//import com.kws.common.log.annotation.Log;
//import com.kws.common.log.enums.BusinessType;
//import com.kws.common.redis.service.RedisService;
//import com.kws.common.security.annotation.InnerAuth;
//import com.kws.common.security.annotation.RequiresPermissions;
//import com.kws.system.api.domain.SysLogininfor;
//import com.kws.system.service.ISysLogininforService;
//
///**
// * 系统访问记录
// *
// * @author zhangyh
// */
//@RestController
//@RequestMapping("/logininfor")
//@Api(tags = "登陆日志管理模块")
//public class SysLogininforController
//{
//    @Autowired
//    private ISysLogininforService logininforService;
//
//    @Autowired
//    private RedisService redisService;
//
////    @RequiresPermissions("system:logininfor:list")
//    @GetMapping("/list")
//    @ApiOperation("分页查询日志管理列表")
//    public R list(SysLogininfor logininfor)
//    {
//        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
//        return R.ok(list);
//    }
//
//    @Log(title = "登录日志", businessType = BusinessType.EXPORT)
//    @RequiresPermissions("system:logininfor:export")
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, SysLogininfor logininfor)
//    {
//        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
//        ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
//        util.exportExcel(response, list, "登录日志");
//    }
//
//    @RequiresPermissions("system:logininfor:remove")
//    @Log(title = "登录日志", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{infoIds}")
//    public R remove(@PathVariable Long[] infoIds)
//    {
//        return R.ok(logininforService.deleteLogininforByIds(infoIds));
//    }
//
//    @RequiresPermissions("system:logininfor:remove")
//    @Log(title = "登录日志", businessType = BusinessType.DELETE)
//    @DeleteMapping("/clean")
//    public R clean()
//    {
//        logininforService.cleanLogininfor();
//        return R.ok();
//    }
//
//    @RequiresPermissions("system:logininfor:unlock")
//    @Log(title = "账户解锁", businessType = BusinessType.OTHER)
//    @GetMapping("/unlock/{userName}")
//    public R unlock(@PathVariable("userName") String userName)
//    {
//        redisService.deleteObject(CacheConstants.PWD_ERR_CNT_KEY + userName);
//        return R.ok();
//    }
//
//    @InnerAuth
//    @PostMapping
//    public R add(@RequestBody SysLogininfor logininfor)
//    {
//        return R.ok(logininforService.insertLogininfor(logininfor));
//    }
//}
